wiki:XmlRpcSubtitlesVote

Version 1 (modified by guest, 16 years ago) (diff)

Created this page [Majky]

SubtitlesVote

Intro

rate subtitles


Description

struct SubtitlesVote(string $token, struct('idsubtitle' => int $idsubtitle, 'score' => int $score) $vote)

allows registered users to rate subtitle idsubtitle giving a score score where 1 is worst and 10 is best.

users cannot rate subtitles they uploaded and each user can rate a specific subtitle only once.


Parameters

Parameters structure:

struct(
  (string) [token],
  struct(
    (string) [idsubtitle],
    (double) [score]
  )
)
token (required)
token string identifying user's session, taken from LogIn output structure.
vote (required)
structure to rate (cast a vote) a subtitle contains:
  • idsubtitle: id of subtitle (NOT subtitle file) user wants to rate
  • score: subtitle rating, must be in interval 1 (worst) to 10 (best).

Return Values

Output is returned in this structure:

struct(
  (string) [status],
  struct(
    (string) [SubRating],
    (string) [SubSumVotes],
    (string) [IDSubtitle]
  ) [data],
  (double) [seconds]
)

and contains these elements:

status
function result code, see list of status codes
data
  • SubRating: average subtitle rating for given subtitles
  • SubSumVotes: number of times these subtitles were rated.
  • IDSubtitle: ID of subtitle in the database (BEWARE this is not the ID of subtitle file but the whole subtitle)
seconds
time taken to execute this command on server

Implementations

There are currently no available sample implementations.


Changelog

Version 1: created this function


Examples

Input

<methodCall>
 <methodName>SubtitlesVote</methodName>
 <params>
  <param>
   <value><string>e13niph67doilhse1me3kb43e4</string></value>
  </param>
  <param>
   <value>
    <struct>
     <member>
      <name>idsubtitle</name>
      <value><int>3337934</int></value>
     </member>
     <member>
      <name>score</name>
      <value><int>10</int></value>
     </member>
    </struct>
   </value>
  </param>
 </params>
</methodCall>

Output

<methodResponse>
 <params>
  <param>
   <value>
    <struct>
     <member>
      <name>status</name>
      <value><string>200 OK</string></value>
     </member>
     <member>
      <name>data</name>
      <value>
       <struct>
        <member>
         <name>SubRating</name>
         <value><string>10.0</string></value>
        </member>
        <member>
         <name>SubSumVotes</name>
         <value><string>1</string></value>
        </member>
        <member>
         <name>IDSubtitle</name>
         <value><string>3337934</string></value>
        </member>
       </struct>
      </value>
     </member>
     <member>
      <name>seconds</name>
      <value><double>5.243</double></value>
     </member>
    </struct>
   </value>
  </param>
 </params>
</methodResponse>

Notes

none yet


See also


Comments

add your comments, hints and suggestions here if you like ...


[Prev] Home [Next]